from configs.serializers import BaseSerializer
from apps.user import models


class UserSerializer(BaseSerializer):
    """用户序列化器"""

    class Meta:
        model = models.User
        fields = ("id", "username", "password", "phone")
        hangers = {
            "password": "get_password",
        }
        extra_kwargs = None

    class Hanger:
        def get_password(self, obj):
            return "******"
